Component({
  options: {
    multipleSlots: true 
  },
  properties: {
    label: { // 表单label
      type: String,
      value: ''
    },
    value: { // 值
      type: String,
      value: ''
    },
    actionList: { //数据
      type: Array,
      value: []
    },
    placeholder: { // 占位符
      type: String,
      value: ''
    },
    showArrow: { //是否展示箭头
      type: Boolean,
      value: false
    },
    showBorder: { //是否展示线条
      type: Boolean,
      value: false
    },
    disabled: { //是否禁用
      type: Boolean,
      value: false
    }
  },
  data: {
    
  },
  methods: {
    onClick(){
      let _this = this;
      let list = _this.data.actionList;
      if(list.length > 6 || _this.data.disabled) return;
      wx.showActionSheet({
        itemList: _this.data.actionList,
        success(res) {
          _this.triggerEvent('change', res.tapIndex)
        },
        fail(res) {
          console.log(res.errMsg)
        }
      })
      
    }
  }
})
